# #!/usr/bin/env python3
# # -*- coding: utf-8 -*-
#
#
# from keywordFrame import config
# import requests
#
#
# class SendReport:
#     # 将测试结果发送到钉钉消息群，webhook通过config文件配置
#     @classmethod
#     def send_ding(cls, formatted_time, pass_count, fail_count, runtime, report_path):
#         pass_rate = 0
#         case_total = pass_count + fail_count
#         if case_total != 0:
#             pass_rate = round(pass_count / case_total * 100, 2)
#         cont = f"自动化测试已经完成，结果为：\n" \
#                f"测试开始时间为：{formatted_time}\n" \
#                f"测试结果通过的数量为：{pass_count}\n" \
#                f"测试结果失败的数量为：{fail_count}\n" \
#                f"测试用例总的数量为：{case_total}\n" \
#                f"测试成功率为：{pass_rate}%\n" \
#                f"测试时长为：{runtime} 分钟\n" \
#                f"测试报告地址为：{report_path} 文件夹中查看\n"
#         data = {
#             "msgtype": "text",
#             "text": {
#                 "content": cont
#             },
#             "at": {
#                 # 要@的人，手机号
#                 "atMobiles": [],
#                 # 是否@所有人
#                 "isAtAll": False
#             }
#         }
#         url = config.ding_Webhook
#         headers = {'Content-Type': 'application/json'}
#         requests.post(url=url, headers=headers, json=data)
#
#
# if __name__ == '__main__':
#     SendReport.send_ding(4, 2, 3.22)

"""
后续增加发邮件功能


"""